#ifndef CAPTURE_TO_FILE
#define CAPTURE_TO_FILE

#include <string>
#include <vector>

struct IFilterGraph;
struct IBaseFilter;
struct IPin;
struct IFileSinkFilter;

class CaptureToFile
{
public:
	static CaptureToFile* instance();
	bool start(const std::wstring& fileName);
	bool stop();
private:
	CaptureToFile(IFilterGraph* filterGraph,  IPin* capturePin);
	bool initialCaptureToFile();
private:
	IFilterGraph* m_FilterGraph;
	IPin* m_CapturePin;
	IPin* m_MuxVideoInputPin;
	IBaseFilter* m_MuxFilter;
	IBaseFilter* m_FileWriter;
	bool m_IsCapture;
	IFileSinkFilter* m_FileSinkFilter;
	std::vector<IPin*> m_AudioEncoderPinList;
	std::vector<IPin*> m_MuxAudioInputPinList;
};

#endif